package com.wfs.myapp.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum GroupMemberStatusEnum {
    PENDING(0, "申请", "可加入"),
    APPROVE(1, "同意", "已加入"),
    REJECT(2, "拒绝", "被拒绝"),
    ;

    private final Integer code;
    private final String msg;
    private final String groupMsg;


    public static String getGroupMsg(Integer code) {
        for (GroupMemberStatusEnum groupMemberStatusEnum : GroupMemberStatusEnum.values()) {
            if (Objects.equals(groupMemberStatusEnum.getCode(), code)) {
                return groupMemberStatusEnum.getGroupMsg();
            }
        }
        return "";
    }
}

